package com.qinggeng.project.api.dto;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qinggeng.common.utils.StringUtils;
import com.qinggeng.common.utils.spring.SpringUtils;
import com.qinggeng.common.utils.text.Convert;
import com.qinggeng.framework.aspectj.lang.annotation.Excel;
import com.qinggeng.project.system.domain.json.PointNameConfig;
import com.qinggeng.project.system.domain.vo.DistributionPointImgVO;
import com.qinggeng.project.system.service.IDistributionPointService;
import com.qinggeng.project.system.service.ISysConfigService;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author 吴鹏飞
 * @date 2020/8/28
 */
@Data
@ApiModel("配送点列表")
public class DistributionPointDto {
    /**
     * 配送点ID
     */
    private Long id;

    /**
     * 配送点名称
     */
    private String pointName;

    /**
     * 果果专员Id
     */
    private Long courierId;

    /**
     * 详细地址
     */
    private String address;

    private Float lng;

    private Float lat;

    /**
     * 配送时间
     */
    private String businessTime;

    /**
     * 配送下班时间
     */
    private String closingTime;

    /**
     * 距离
     */
    private Double distance;

    /**
     * 距离
     */
    private String distanceName = "";

    /**
     * 配送点电话
     */
    private String pointPhone;

    /**
     * 分拣区域
     **/
    private String sortArea;

    /**
     * 配送点编号
     **/
    private String sortAreaNum;

    //门头照
    private String pointImg;

    //环境照
    private String listImg;

    private String isOpen;

    private DistributionPointImgVO distributionPointImgVO;

    private String province;


    private String city;

    /**
     * 区域名称
     */
    private String area;


    private String delFalg;

    private String cityCode;

    //商户名称
    private String name;
    //查询条件
    private String queryName;


    private Long shopId;

    @JsonIgnore
    private static final String DEFAULT_SUFFIX_NAME="生鲜馆";

    @JsonIgnore
    public String getPointNameWithoutSuffixName(){
        return this.pointName;
    }

    public String getPointName(){
        String suffixName=SpringUtils.getBean(IDistributionPointService.class).getPointSuffixName(DEFAULT_SUFFIX_NAME);
        return this.pointName+suffixName;
    }


    public DistributionPointImgVO getDistributionPointImgVO() {
        return this.distributionPointImgVO = new DistributionPointImgVO(this.pointImg, this.listImg);
    }
}
